<!DOCTYPE html>
<html>
<head lang="en">
    <meta charset="UTF-8">
    <title></title>
</head>
<body>
    <div>div</div>
    <p>p</p>
    <div>div</div>
    <span>span</span>
    <p>p</p>
    <div>div</div>
</body>
<script>
    var divs=document.querySelectorAll("div");
    var ps=document.querySelectorAll("p");
    for(var i=0;i<divs.length;i++){
        divs[i].style.border="1px solid red";
    }

</script>
</html>